package com.project.erp.service.system.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.project.erp.dao.system.DocNumberDao;
import com.project.erp.model.system.DocNumber;
import com.project.erp.service.system.DocNumberService;

@Service
@Transactional
public class DocNumberServiceImpl implements DocNumberService {

	@Autowired
	private DocNumberDao docNumberDao;
	
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	@Override
	public DocNumber getDocNumber(DocNumber docNumber) {
		return docNumberDao.getDocNumber(docNumber);
	}

	@Transactional(rollbackFor=Exception.class)
	@Override
	public void save(DocNumber docNumber) {
		docNumberDao.save(docNumber);
	}

	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	@Override
	public DocNumber findDocNumberById(Long id) {
		return docNumberDao.get(id);
	}

	@Transactional(rollbackFor=Exception.class)
	@Override
	public void eidt(DocNumber docNumber) {
		docNumberDao.save(docNumber);
	}

}
